package com.yykj.common.util;

import java.math.BigDecimal;

/**
 * Created by chenl
 */
public class LocalMathUtil {
    public static int randomInt(){
        return (int)(Math.random() * 999999);
    }

    public static Integer getPage(Integer page){
        if(page == null){
            page = 0;
        }
        if(page >= 1){
            page -= 1;
        }
        return page;
    }

    public static Integer getSize(Integer size){
        if(size == null || size <= 0){
            size = 20;
        }
        return size;
    }

    public static Integer getWxPrice(BigDecimal price) {
        return price.multiply(new BigDecimal(100)).intValue();
    }
}
